/**
 * author:wos
 * time:2024-1-4
 * title:目录权限查询列表
 */
const parseQueryParams = require("../../../utils/parseQueryParams");
const redis = require('../../../modules/redis')
async function logout(ctx, next) {

    const url = ctx.request.url
    const query = parseQueryParams(url)
    try {
        let rs = await global.query(`UPDATE sys_user SET token='' where userId = ${query.userId}`)
        await redis.connect()
        await redis.delete(query.userName)
        global.response(ctx, {
            "status":200,
            "code": 200,
            "data": {},
            "msg":'success'
        })
    } catch (err) {
        global.serverError(ctx)
    }
}
module.exports = logout


